package dao;

import java.util.List;

import main.DataTransferObject;

public interface UserDAO {

	/**
	 * This method will get the total number of unique entries in the User table
	 * @return
	 */
	public int getNumberOfUsers();
	
	/**
	 * DOES NOT WORK, RETURNS NULL
	 * 
	 * ,but it was suppose to work like this...
	 * 
	 * Will get users matching the criteria sent in.  
	 * Code example using criteria...
	 * 
	 * AccessDTO dto = new AccessDTO();
	 * dto.setAlgorithmName("bubblesort");  //Not sure if valid Algorithm, just example...
	 * UserDAO dao = UserDAO.Factory.getUserDAO();
	 * ArrayList<AccessDTO> userList = dao.getUsers(dto);
	 * //List of AccessDTO objects with usernames set.
	 * for(AccessDTO aDTO : userList){
	 *     System.out.println(aDTO.getUsername();
	 * }
	 * 
	 * 
	 * @param criteria
	 * @return null
	 */
	public List<DataTransferObject> getUsers(DataTransferObject criteria);
	
	
	/**
	 * Gets all the users in the database.
	 * @return a list of all the Users in the database.
	 */
	public List<DataTransferObject> getAllUsers();

	/**
	 * Creates or updates a Username in the given input DTO
	 * @param inDTO - must set the username.
	 * @return boolean whether successful or not
	 */
	boolean createOrUpdate(DataTransferObject inDTO);

	/**
	 * Gets the user ID associated by the given username.   Return -1 if username doesn't exist
	 * or if an error occurred.
	 * @param username
	 * @return returns the user id of a given username.
	 */
	public int getUserID(String username);

	/**
	 * Checks to see if a username exists.
	 * @param username
	 * @return
	 */
	public boolean doesUserExist(String username);
	
}
